package com.ruoyi.project.business.domain.strategy;

import com.ruoyi.project.business.domain.entity.DailyScheduleEmp;
import com.ruoyi.project.business.domain.model.daily.DailyScheduleSolution;
import com.ruoyi.project.business.domain.model.daily.TimePeriodMirror;
import com.ruoyi.project.business.domain.ruleengine.CommonDailyScheduleAssignEngine;
import com.ruoyi.project.business.domain.rules.RulesFactory;

import java.util.List;

/**
 * 聚合了哪些 rule 是需要处理的
 */
public class CommonDailyStrategy {

    public DailyScheduleSolution doDailyAssign(List<DailyScheduleEmp> emps, List<TimePeriodMirror> timePeriods) {
        new RulesFactory().preDealRulesForDaily(emps);
        CommonDailyScheduleAssignEngine assignEngine = new CommonDailyScheduleAssignEngine();
        assignEngine.setEmps(emps);
        assignEngine.setTimePeriods(timePeriods);
        assignEngine.setAssignMode(1);

        DailyScheduleSolution solution = assignEngine.tryAssign();
        return solution;
    }


}
